<div class="card-body">
    <div class="form-group">
        <select class="form-control" name="category_id">
            @foreach($categories as $category)
                <option value="{{$category['id']}}"
                        {{active_class($topic['category_id']==$category['id'],'selected')}}
                >{{$category['name']}}</option>
            @endforeach
        </select>
    </div>
    <div class="form-group">
        <input type="text" name="title" value="{{$topic['title']}}" class="form-control" placeholder="请输入贴子标题">
    </div>
    <div class="form-group">
        <div id="editormd">
            <textarea style="display:none;" name="content">{{$topic['content']}}</textarea>
        </div>
        @push('js')
            <script>
                require(['hdjs'], function (hdjs) {
                    hdjs.editormd("editormd", {
                        width: '100%',
                        height: 300,
                        toolbarIcons: function () {
                            return [
                                "bold", "del", "italic", "quote", "|",
                                "list-ul", "list-ol", "hr", "|",
                                "link", "hdimage", "code-block", "|",
                                "watch", "preview", "fullscreen"
                            ]
                        },
                        //editor.md库位置
                        path: "{{asset('org/hdjs')}}/package/editor.md/lib/"
                    });
                });
            </script>
        @endpush
    </div>
</div>
